package com.example.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel(description = "用户实体")
public class User {
    @ApiModelProperty(value = "用户ID", example = "1")
    private Long id;
    
    @ApiModelProperty(value = "用户姓名", required = true, example = "张三")
    private String name;
    
    @ApiModelProperty(value = "手机号码", example = "13800138000")
    private String phone;
    
    @ApiModelProperty(value = "邮箱", example = "example@example.com")
    private String email;
    
    @ApiModelProperty(value = "密码", required = true, example = "123456")
    private String password;
    
    @ApiModelProperty(value = "哈希密码", hidden = true)
    private String hashedPassword;
    
    @ApiModelProperty(value = "创建时间", example = "2024-06-05 15:30:00")
    private String createdTime;
    
    @ApiModelProperty(value = "是否激活", example = "true")
    private Boolean isActive;
    
    @ApiModelProperty(value = "是否超级管理员", example = "false")
    private Boolean isSuperuser;
    
    @ApiModelProperty(value = "手机号是否验证", example = "false")
    private Boolean isPhoneVerified;
    
    @ApiModelProperty(value = "邮箱是否验证", example = "false")
    private Boolean isEmailVerified;
    
    // 非数据库字段，仅用于接收验证码
    @ApiModelProperty(value = "验证码", example = "123456")
    private transient String code;

    // 手动补充getter/setter，兼容所有调用
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getName() { return name; }
    public void setName(String name) { this.name = name; }

    public String getPhone() { return phone; }
    public void setPhone(String phone) { this.phone = phone; }

    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }

    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }

    public String getHashedPassword() { return hashedPassword; }
    public void setHashedPassword(String hashedPassword) { this.hashedPassword = hashedPassword; }

    public String getCreatedTime() { return createdTime; }
    public void setCreatedTime(String createdTime) { this.createdTime = createdTime; }

    public Boolean getIsActive() { return isActive; }
    public void setIsActive(Boolean isActive) { this.isActive = isActive; }
    public Boolean isActive() { return isActive; }
    public void setActive(Boolean isActive) { this.isActive = isActive; }

    public Boolean getIsSuperuser() { return isSuperuser; }
    public void setIsSuperuser(Boolean isSuperuser) { this.isSuperuser = isSuperuser; }
    public Boolean isSuperuser() { return isSuperuser; }
    public void setSuperuser(Boolean isSuperuser) { this.isSuperuser = isSuperuser; }

    public Boolean getIsPhoneVerified() { return isPhoneVerified; }
    public void setIsPhoneVerified(Boolean isPhoneVerified) { this.isPhoneVerified = isPhoneVerified; }
    public Boolean isPhoneVerified() { return isPhoneVerified; }
    public void setPhoneVerified(Boolean isPhoneVerified) { this.isPhoneVerified = isPhoneVerified; }

    public Boolean getIsEmailVerified() { return isEmailVerified; }
    public void setIsEmailVerified(Boolean isEmailVerified) { this.isEmailVerified = isEmailVerified; }
    public Boolean isEmailVerified() { return isEmailVerified; }
    public void setEmailVerified(Boolean isEmailVerified) { this.isEmailVerified = isEmailVerified; }

    public String getCode() { return code; }
    public void setCode(String code) { this.code = code; }
} 